Data, such as extended markup language (XML) data in documents or data in relational databases, may be interrogated for various purposes using queries. Queries are formulated in a particular query language, such as XML Query Language (XQUERY) and structure query language (SQL). Queries typically include a set of conditions for determining which data to access. For example, such conditions might include if-then-else, for, concatenate, and return statements. Arguments for such functional statements might include various resources, such as particular data and other functional statements. Complex queries typically include multiple conditions designed to further specify the data interrogated. Based upon the conditions indicated in the query, appropriate information is accessed, returned, or otherwise manipulated.
To build a query without assistance, a user is generally required to posses detailed knowledge of the semantics and syntax of the query language. Thus, a user must understand the terms of the language, or semantics. Furthermore, the user must understand how to put the terms together, or syntax, for the language such that the query is understandable. Using this knowledge of term meanings (semantics) and syntax (how terms are related in building a particular query), a user may be able to formulate the desired query and access the data of interest.
To facilitate building of queries, various conventional tools are available. Conventional query builders, such as conventional SQL query builders, may be used in some instances. Such conventional query builders are particularly useful to novice users that have a limited knowledge of the semantics and/or syntax of the query language being used. However, more experienced users may also find the conventional query builder useful, particularly in formulating complex queries. For example, conventional SQL query builders may allow the user to formulate complex queries, containing multiple functional statements. Alternatively, conventional mapping tools might be used. Such conventional mapping tools allow the user to map the source XML to the expected output XML. The conventional mapping tool then generates the query without the user being explicitly aware of it Thus, a user might be able to formulate at least simple queries using such a mapping tools.
Although conventional query builders and mapping tools can be used, one of ordinary skill in the art will readily recognize that such conventional query builders and mapping tools have limited utility for certain scripting languages. Such scripting languages, including XML, are relatively complex. For example, such scripting languages may include logic and variable definitions that must be defined for complex queries. Most conventional query builders typically still require that the user understand the semantics of such query languages in order to build a complex query. Alternatively, other conventional query builders are capable of hiding the semantics of such query languages from a user. Typically, such conventional query builders view and represent only the complete query to the user. However, a user is also unable to create complex queries in such conventional query builders without greater knowledge of the semantics and/or syntax of the query language. Similarly, conventional mapping tools hide the logic and semantics of the query language, but do not allow users to create complex queries without a greater understanding of the semantics of the query language.
Accordingly, what is needed is a more flexible query builder that allows users to build complex queries with limited knowledge of the semantics of a query language, such as XQUERY. The present invention addresses such a need.